package net.hn.hnms.biz.cockpit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.hn.hnms.biz.cockpit.domain.WarnInfo;
import net.hn.hnms.biz.cockpit.domain.vo.OptionVo;
import net.hn.hnms.biz.cockpit.mapper.WarnInfoMapper;
import net.hn.hnms.biz.cockpit.service.IWarnInfoService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class WarnInfoServiceImpl extends ServiceImpl<WarnInfoMapper, WarnInfo> implements IWarnInfoService {

    @Override
    public List<WarnInfo> getWarnInfo(String mineCode) {
        List<WarnInfo> result = Collections.emptyList();
        result = baseMapper.selectList(new LambdaQueryWrapper<WarnInfo>().eq(WarnInfo::getMineCode, mineCode).orderByDesc(WarnInfo::getWarnTime));
        return result;
    }

    @Override
    public List<OptionVo> getMonitorAnalyse(String mineCode) {
        return baseMapper.getMonitorAnalyse(mineCode);
    }
}
